package com.jeecg.p3.dzdp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.jeecgframework.p3.core.utils.common.PageList;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.Pagenation;
import org.springframework.stereotype.Service;

import com.jeecg.p3.dzdp.dao.WxActDzdpNewProductDao;
import com.jeecg.p3.dzdp.entity.WxActDzdpNewProduct;
import com.jeecg.p3.dzdp.service.WxActDzdpNewProductService;

@Service("WxActDzdpNewProductService")
public class WxActDzdpNewProductServiceImpl implements WxActDzdpNewProductService {
	@Resource
	private WxActDzdpNewProductDao WxActDzdpNewProductDao;

	@Override
	public void doAdd(WxActDzdpNewProduct WxActDzdpNewProduct) {
		WxActDzdpNewProductDao.add(WxActDzdpNewProduct);
	}

	@Override
	public void doEdit(WxActDzdpNewProduct WxActDzdpNewProduct) {
		WxActDzdpNewProductDao.update(WxActDzdpNewProduct);
	}

	@Override
	public void doDelete(String id) {
		WxActDzdpNewProductDao.delete(id);
	}

	@Override
	public WxActDzdpNewProduct queryById(String id) {
		WxActDzdpNewProduct WxActDzdpNewProduct  = WxActDzdpNewProductDao.get(id);
		return WxActDzdpNewProduct;
	}

	@Override
	public PageList<WxActDzdpNewProduct> queryPageList(
		PageQuery<WxActDzdpNewProduct> pageQuery) {
		PageList<WxActDzdpNewProduct> result = new PageList<WxActDzdpNewProduct>();
		Integer itemCount = WxActDzdpNewProductDao.count(pageQuery);
		List<WxActDzdpNewProduct> list = WxActDzdpNewProductDao.queryPageList(pageQuery,itemCount);
		Pagenation pagenation = new Pagenation(pageQuery.getPageNo(), itemCount, pageQuery.getPageSize());
		result.setPagenation(pagenation);
		result.setValues(list);
		return result;
	}
	
	public List<WxActDzdpNewProduct> queryOpts(String jwid){
		return  WxActDzdpNewProductDao.queryOpts(jwid);
	}
}
